package com.example;

import com.iogogogo.activity.annotation.Activity;
import com.iogogogo.activity.annotation.EnableActivityConfiguration;
import com.iogogogo.activity.annotation.EnableWebLogConfiguration;
import com.iogogogo.activity.annotation.WebLog;
import com.iogogogo.activity.enums.ActivityEventEnum;
import com.iogogogo.activity.enums.ActivityTypeEnum;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


@RequestMapping("/weblog")
@RestController
@EnableActivityConfiguration
@EnableWebLogConfiguration
@SpringBootApplication
public class ExampleDemoApplication {

    private final static Map<String, Object> OBJECT_MAP = new HashMap<>();

    public static void main(String[] args) {
        SpringApplication.run(ExampleDemoApplication.class, args);
    }

    @WebLog
    @Activity(type = ActivityTypeEnum.TYPE_PERSON, event = ActivityEventEnum.EVENT_QUERY, source = "{\"0\":\"无操作\",\"1\":\"新增\",\"2\":\"删除\",\"3\":\"修改\",\"4\":\"查询\"}", sourceType = Map.class, target = "", targetType = String.class, status = 0, description = "查询用户信息")
    @GetMapping("/index")
    public String index() {
        return HttpStatus.OK.getReasonPhrase();
    }
}
